﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;

public class ZjhKillEffect : MonoBehaviour {

	public List<Sprite> list = new List<Sprite> ();
	public int Frame;
	private int index = 0;
	private int listIndex = 0;
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {
		if(index > Frame){
			index = 0;
			GetComponent<Image> ().sprite = list [listIndex];
			GetComponent<Image> ().SetNativeSize ();
			listIndex++;
			if (listIndex >= list.Count) {
				listIndex = 0;
			}
		}
		index++;
	}
}
